function removeCookie(key, ops={}){
    ops.expires = -1;
    setCookie(key, "ahfjasdhjv", ops);
}

function getCookie(key){
    const arr = document.cookie.split("; ")
    for(let i=0;i<arr.length;i++){
        if(arr[i].split("=")[0] === key){
            return arr[i].split("=")[1];
        }
    }
    return null;
}

function setCookie(key, val, ops={}){
    let e = "";
    if(ops.expires){
        const d = new Date();
        d.setDate(d.getDate() + ops.expires)
        e = ";expires="+d;
    }
    let p = ops.path ? ";path="+ops.path : "";
    document.cookie = `${key}=${val}${e}${p}`;
}